
# assert 语句的用法

def get_score():
    s = int(input('请输入成绩:'))
    assert 0 <= s <= 100, '成绩超出范围'
    # 等同于
    # if not (0 <= s <= 100):
    #     raise AssertionError('成绩超出范围')
    return s

score = get_score()
print('score:', score)